export default request => ({
  /**   请求附表数据 */
  getFormDesignSubList: params => request({
    url: '/form/formConfiguration/sublist',
    method: 'get',
    params
  }),
  getFormDesignList: params => request({  // 请求主表数据
    url: '/form/formConfiguration/list',
    method: 'get',
    params
  }),
  getFormDic:  params =>  request({  // 请求主表数据
    url: '/sys/dict/list',
    method: 'get',
    params
  }),

  getFlowFormDictData: parameter =>  // 根据参数查字典{type:'table/code',value:'',label:'',code:''}
    request({
      url: '/sys/dict/getFlowFormDictData',
      method: 'post',
      data: parameter
    }),


  getFormDesinList: () =>  // 查询Form List
    request({
      url: '/node/getFormDesignList',
      method: 'get'
    }),
  saveFormDesinList: data =>  // 保存form 图标配置list
    request({
      url: '/node/saveFormDesignConfig',
      method: 'post',
      data: data
    }),
  getTableList: () =>   // 获取系统所有动态表
    request({
      url: '/node/getDymicTables',
      method: 'get'
    }),
  getFieldsByTable: () =>   // 获取表的所有字段
    request({
      url: '/node/getFieldsByTables',
      method: 'get'
    }),
  getDictList:  (params, headersParams = {}) =>
    request({  // 请求主表数据
      url: '/onlcode/saas/dict/queryDictList',
      method: 'post',
      params,
      headers: {
        ...headersParams
      }
    }),
  getDbTableColumns:  (params, headersParams = {}) =>
    request({  // 获取数据表所有列
      url: '/onlcode/column/listByTableId',
      method: 'get',
      params,
      headers: {
        ...headersParams
      }
    }),
  getLogisticTrackInfo: (params, headersParams = {}) => request({
    url: '/onlcode/expTrace/record',
    method: 'get',
    params,
    headers: {
      ...headersParams
    }
  }),
  // onlcodeDeleteForm: (params, headersParams = {}) => request({
  //   url: '/onlcode/form/deleteForm',
  //   method: 'get',
  //   params,
  //   headers: {
  //     ...headersParams
  //   }
  // }),
  onlcodeDeletePage: (params, headersParams = {}) => request({
    url: '/onlcode/page/deletePage',
    method: 'get',
    params,
    headers: {
      ...headersParams
    }
  }),
  // V2.0分页 查询表单组件列表
  QueryFormComponentList: (data) =>
    request({
      url: `/onlcode/lowcode/formComponent/queryByPage?pageNo=${data.pageNo}&pageSize=${data.pageSize}`,
      method: 'post',
      data
    }),
  SaveFormComponent: (data) =>
    request({
      url: 'onlcode/lowcode/formComponent/saveOrUpdateFormComponent',
      method: 'post',
      data
    }),
  QueryFormConfigDetails: (params) =>
    request({
      url: '/onlcode/lowcode/formComponent/getFormById',
      method: 'get',
      params
    }),
  CopyFormConfig: (params) =>
    request({
      url: '/onlcode/lowcode/formComponent/copyFormComponent',
      method: "get",
      params
    }),
  DeleteFormConfig: (params, headersParams = {}) =>
    request({
      url: '/onlcode/lowcode/formComponent/deleteFormComponent',
      method: 'get',
      params,
      headers: {
        ...headersParams
      }
    }),
  QueryTableComponentList:(data, urlParams={},headersParams = {}) =>
    request({
      url: `/onlcode/lowcode/tableComponent/queryByPage?pageNo=${urlParams.pageNo}&pageSize=${urlParams.pageSize}`,
      method: 'post',
      data,
      headers: {
        ...headersParams
      }
    }),
  GET_GENERATE_FORM_PARAMS:(params) =>
    request({
      url: `/onlcode/lowcode/formComponent/getGenerateParam`,
      method: 'get',
      params
    }),
  SAVE_FORM_GENERATE_CODE:(params) =>
    request({
      url: `/onlcode/lowcode/formComponent/generateCode`,
      method: 'post',
      data: params
    })
})
